package com.zc.im.seqsvr.vo.client;

import com.zc.im.seqsvr.vo.config.FeignConfig;
import com.zc.im.seqsvr.vo.router.RoutePath;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;

/**
 * Project：im
 * Date：2022/4/18
 * Time：17:56
 * Description：
 *
 * @author Challen.Zhang
 * @version 1.0
 */
@FeignClient(name = "im-seqsvr", configuration = FeignConfig.class)
public interface SeqsvrClient {

    /**
     * 根据userId获取seq
     *
     * @param userId userId
     * @return seq
     */
    @PostMapping(RoutePath.INCR_AND_GET_SEQ_BY_USER_ID)
    Long getSeqByUserId(@PathVariable("userId") Long userId);

    /**
     * 根据userId获取seq
     *
     * @param userId userId
     * @return seq
     */
    @PutMapping(RoutePath.CREATE_SEQ_BY_USER_ID)
    Long createSeqByUserId(@PathVariable("userId") Long userId);

}
